<div class="wnetrze">
    <div><h3>Użytkownicy</h3></div>
    <p><?php echo $this->paginationControl($this->paginator, 'Sliding', 'paginator/paginator.phtml'); ?></p>
    <table class="standard">
        <tr>
            <th>E-mail</th>
            <th>Imię i nazwisko</th>
            <th>Firma</th>
            <th>Rola</th>
            <th colspan="4">Akcje</th>
        </tr>
        <?php
        foreach ($this->paginator as $user):
            $status = $user->status;
            $active = "1";
            if ($status == $active) {
                $link = "0";
                $label = "Zawieś";
            } else {
                $link = "1";
                $label = "Aktywuj";
            }
            $rola = $user->rola;
            $usr = "user";
            if ($rola == $usr) {
                $role = "admin";
                $text = "+ admin";
                $rola = "użytkownik";
            } else {
                $role = "user";
                $text = "+ użytkownik";
                $rola = "administrator";
            }
        ?>
            <tr class="<?php echo $this->cycle(array("light", "dark"))->next() ?>">
                <td><a href="/admin/profil/id/<? echo $user->id ?>"><?php echo $user->email; ?></a></td>
                <td><?php echo $user->imie . ' ' . $user->nazwisko; ?></td>
                <td><?php echo $user->firma; ?></td>
                <td><?php echo $rola; ?> (<a href="/admin/zmien-role/id/<?php echo $user->id; ?>/rola/<?php echo $role ?>"><?php echo $text; ?></a>)</td>
                <td><a href="/admin/zmiana-statusu/id/<?php echo $user->id; ?>/status/<?php echo $link ?>"><?php echo $label; ?></a></td>
                <td><a href="/admin/usun-uzytkownika/id/<?php echo $user->id; ?>">Usuń</a></td>
            </tr>
<?php endforeach; ?>
    </table>
    <div class="clear"><h3><a href="/admin/">Powrót do panelu admina</a></h3></div>
</div>